<?php


namespace App\frontend\services\member;

use App\common\services\BaseServices;
use app\frontend\models\MemberAddressModel;
use Illuminate\Support\Facades\Validator;

class MemberAddressServices extends BaseServices
{

    /**
     * 验证参数
     * @param $data
     * @return array
     */
    public static function CheckAddressParam($data){
        if (!$data) {
            return self::returnError(101, '未获取到数据!');

        }
        $validator = Validator::make(
            $data,
            MemberAddressModel::rules(),
            MemberAddressModel::message()
        );
        if ($validator->fails()) {
            $msg = $validator->errors()->all();

            return self::returnError(102, $msg[0]);
        }
        return self::returnSuccess('ok');
    }

}
